<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport"　content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <title>详情</title>
    <link rel="stylesheet" href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}"/>
    <link rel="stylesheet" href="../static/css/main.css" th:href="@{/css/main.css}"/>

    <style>
    </style>
</head>

<body>

<div class="header">
    <div class="container">
        <!--        <img src="../static/image/banner.jpg"  th:src="@{image/banner.jpg}" alt=""/>-->
    </div>
</div>

<div class="searchBar">
    <div class="container">

        <div class="left">
            <img class="dateImg no_fl" th:src="@{/image/date_icon.png}" alt=""/>
            <p class="date no_fl"></p>
        </div>

    </div>
</div>
<div class="container bg-f">
    <section class="section newlist-section clearfix">
        <div class="container">
            <div class="textContent">
                <div class="detailTitle">
                    <h4>任丘市司法局2020年度“双随机、一公开”抽查计划</h4>
                    <p class="time">
                        <span>任丘市司法局 </span>
                        <span>2020-07-30 14:24:14</span>
                    </p>
                </div>
            </div>
            <div class="area">
                <div class="htmlContent" id="htmlArea" style="display:none">

                </div>
                <div class="picContent" style="display:none">
                    <img src="" alt=""/>
                </div>
                <div class="pdfContent" style="display:none">
                    <embed src='' type="application/pdf" width="100%" height="800"/>
                </div>
            </div>
        </div>
        <div class="next">
            <a  class="back">返回</a>
        </div>
    </section>
</div>

<script src="../static/js/jquery-3.4.1.min.js" th:src="@{/js/jquery-3.4.1.min.js}"></script>
<script src="../static/js/common.js" th:src="@{/js/common.js}"></script>
<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:inline="javascript" >

    $('.back').click(function(){
      window.history.back(-1);
    })

    var currentTime = formatDate();
    $('.date').html('今天是：' + currentTime);

    var resType = /*[[${resType}]]*/'';
    var resUrl = /*[[${resUrl}]]*/'';
    var title = /*[[${title}]]*/'';
    var createTime =/*[[${createTime}]]*/'';
    var unitName =/*[[${unitName}]]*/'';

    $('.detailTitle h4').html(title);
    $('.detailTitle span:first-child').html(unitName);


    if (resType && resType == 3) {
        var id = /*[[${id}]]*/'';
        getDetails(id);
        $('.htmlContent').show().siblings('div').hide();
    }
    if (resType && resType == 1) {
        $('.picContent').show().siblings('div').hide();
        $('.picContent img').attr('src', resUrl)
    }
    if (resType && resType == 2) {
        $('.pdfContent').show().siblings('div').hide();
        $('.pdfContent embed').attr('src', resUrl)
    }

    function getDetails(id) {
        $.post("/rqzf/content",
            {
                publicityId: id,
            },
            function (ret) {
                if (ret.success == 0) {
                    var str = '';
                    var details = ret.data.content;
                    $('.detailTitle span:last-child').html(createTime);
                    $('.htmlContent').html(details);
                }
            })
    }

</script>
</body>

</html>
